home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Python 1.3 / source code / Nt / Modules / dl.nt.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-17  |  805 b   |  38 lines  |  [TEXT/R*ch]

  1. /*
  2.  
  3. Entry point for the Windows NT DLL.
  4.  
  5. About the only reason for having this, is so initall() can automatically
  6. be called, removing that burden (and possible source of frustration if 
  7. forgotten) from the programmer.
  8.  
  9. This now also calls WSACleanup to clean up sockets.  The init of sockets
  10. is done by the socketmodule, but modules have no terminate handler.
  11. The sockets doco says it is OK to call this if not initialised, so here is
  12. a safe place to do it.
  13.  
  14. */
  15. #include "windows.h"
  16.  
  17. /* NT and Python share these */
  18. #undef INCREF
  19. #undef DECREF
  20.  
  21. #include "allobjects.h"
  22. BOOL    WINAPI    DllMain (HANDLE hInst, 
  23.                         ULONG ul_reason_for_call,
  24.                         LPVOID lpReserved)
  25. {
  26.     switch (ul_reason_for_call)
  27.     {
  28.         case DLL_PROCESS_ATTACH:
  29.             initall();
  30.             break;
  31.         case DLL_PROCESS_DETACH:
  32.             break;
  33.  
  34.     }
  35.  
  36.     return TRUE;
  37. }
  38.